package com.dorado.example.vo;

import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 基于此对象封装用户行为日志?
 * 谁在什么时间执行了什么操作,访问了什么方法,传递了什么参数,访问时长是多少.
 */
@Builder(toBuilder = true)
@ToString(callSuper = true)
@Document
@Data
public class AccessLog  implements Serializable {
    @Id
    private String id;

    private String ip;

    private String host;

    private Integer port;

    private String uri;

    private String path;

    private String routeId;

    private String udid;

    private String area;

    private String username;

    private String method;

    private String params;

    private String headers;

    private String requestBody;

    private String responseBody;

    private String error;

    private LocalDateTime startTime;

    private LocalDateTime endTime;

    private Integer responseCode;

    private Long elapsedTime;

}
